package testGroovy;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Created by houjinxin on 15/11/27.
 */
public class TestRegexJava {

    public static void main(String[] args) {
        Pattern p = Pattern.compile("b*g");
        Matcher m = p.matcher("bbbbbbg");
        boolean b = m.matches();
        System.out.println(b);
        System.out.println(m.group());
        System.out.println("bbbbbbg".substring(m.start(), m.end()));
    }
}
